package system

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type OrderRouter struct{}

func (s *OrderRouter) InitOrderRouter(Router *gin.RouterGroup, RouterPub *gin.RouterGroup) {
	orderRouter := Router.Group("order").Use(middleware.OperationRecord())
	orderRouterWithoutRecord := Router.Group("order")

	orderPublicRouterWithoutRecord := RouterPub.Group("order")
	{
		orderRouter.POST("updateOrderStatus", orderRouterApi.UpdateOrderStatus) // 更新订单状态
	}
	{
		orderRouterWithoutRecord.GET("getAllOrders", orderRouterApi.GetAllOrders)      // 获取所有订单
		orderRouterWithoutRecord.GET("getOrderList", orderRouterApi.GetOrderList)      // 获取订单列表
		orderRouterWithoutRecord.GET("getOrderInfo", orderRouterApi.GetOrderByOrderNo) // 获取订单详情
	}
	{
		orderPublicRouterWithoutRecord.GET("getOrderStats", orderRouterApi.GetOrderStats) // 获取订单统计
	}
}
